package com.qfedu.mall.service.Impl;

import com.qfedu.mall.beans.entity.Live;
import com.qfedu.mall.beans.entity.Video;
import com.qfedu.mall.common.vo.ResStatus;
import com.qfedu.mall.common.vo.ResultVO;
import com.qfedu.mall.mapper.VideoMapper;
import com.qfedu.mall.service.VideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author dyw
 * @Date 2021年12月08日 19:25
 */
@Service
public class VideoServiceImpl implements VideoService {

    @Autowired
    private VideoMapper videoMapper;

    @Override
    public ResultVO getAllVideo() {

        List<Video> videos = videoMapper.selectAllVideo();
        ResultVO resultVO = new ResultVO(ResStatus.OK,"success",videos);
        return resultVO;
    }

    @Override
    public ResultVO getLiveCover() {
        List<Live> lives = videoMapper.getLiveCover();
        ResultVO resultVO = new ResultVO(ResStatus.OK,"Success",lives);
        return resultVO;
    }
}
